package ua.org.inspace.nosqlgui;

import java.util.logging.Handler;
import java.util.logging.LogRecord;

/**
 * Created by: Mykhailo Matiiasevych
 * Date: 03.11.11
 * Time: 13:44
 */
public class LoggerHandler extends Handler {
    private MainForm form;
    private String msg;

    public LoggerHandler(MainForm form, String msg) {
        this.form = form;
        this.msg = msg;
    }

    @Override
    public void publish(LogRecord record) {
        form.log(msg + " " + record.getMessage());
    }

    @Override
    public void flush() {
    }

    @Override
    public void close() throws SecurityException {
    }
}
